home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / OpenGL / opengldoc / glspec / rescale_normal.spec < prev    next >
Encoding:
Text File  |  1996-11-11  |  4.0 KB  |  156 lines

  1. Name
  2.  
  3.     EXT_rescale_normal
  4.  
  5. Name Strings
  6.  
  7.     GL_EXT_rescale_normal
  8.  
  9. Version
  10.  
  11.     $Date: 1996/04/02 00:08:36 $ $Revision: 1.2 $
  12.  
  13. Number
  14.  
  15.     27
  16.  
  17. Dependencies
  18.  
  19.     None
  20.  
  21. Overview
  22.  
  23.     When normal rescaling is enabled a new operation is added to the
  24.     transformation of the normal vector into eye coordinates.  The normal vector 
  25.     is rescaled after it is multiplied by the inverse modelview matrix and 
  26.     before it is normalized.  
  27.  
  28.     The rescale factor is chosen so that in many cases normal vectors with unit
  29.     length in object coordinates will not need to be normalized as they
  30.     are transformed into eye coordinates.
  31.  
  32. New Procedures and Functions
  33.  
  34.     None
  35.  
  36. New Tokens
  37.  
  38.     Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
  39.     and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
  40.     and GetDoublev:
  41.  
  42.     RESCALE_NORMAL_EXT
  43.  
  44. Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
  45.  
  46.     Section 2.9.3
  47.  
  48.     Finally, we consider how the ModelView transformation state affects
  49.     normals. Normals are of interest only in eye coordinates, so the rules
  50.     governing their transformation to other coordinate systems are not
  51.     examined.  
  52.  
  53.     Normals sent to the GL may or may not have unit length.  If rescaling is 
  54.     enabled, then normals specified with the Normal3 command are rescaled after 
  55.     transformation by the ModelView Inverse. 
  56.  
  57.     If normalization is enabled, then normals specified with the Normal3 
  58.     command are normalized after transformation by the model-view inverse 
  59.     matrix and after rescaling if rescaling is enabled.  Normalization and 
  60.     rescaling are controlled with
  61.  
  62.         void Enable( enum target);
  63.  
  64.     and
  65.  
  66.         void Disable( enum target);
  67.  
  68.     with target equal to NORMALIZE or RESCALE_NORMAL. This requires two 
  69.     bits of state.  The initial state is for normals not to be normalized or 
  70.     rescaled.
  71.     .
  72.     .
  73.     .
  74.  
  75.     Therefore, if the modelview matrix is M, then the transformed plane equation 
  76.     is
  77.  
  78.      (n_x' n_y' n_z' q') = ((n_x n_y n_z q) * (M^-1)),
  79.  
  80.     the rescaled normal is  
  81.  
  82.      (n_x" n_y" n_z")  = f * (n_x' n_y' n_z'),
  83.  
  84.     and the fully transformed normal is
  85.               
  86.            1                               (n_x")
  87.      --------------------------------          (n_y")               (2.1)
  88.       ____________________________________     (n_z")
  89.      V (n_x")^2 + (n_y")^2 + (n_z")^2
  90.  
  91.      If rescaling is disabled then f is 1, otherwise f may be computed
  92.      as follows:
  93.  
  94.      Let m_ij denote the matrix element in row i and column j of M^-1, 
  95.      numbering the topmost row of the matrix as row 1, and the leftmost 
  96.      column as column 1. Then let 
  97.  
  98.  
  99.                               1
  100.                       __________
  101.             f =           ________________________________
  102.                   V (m_31)^2 + (m_32)^2 + (m_33)^2  
  103.  
  104.      An implementation may chose a different algorithm to compute f
  105.      as long as it satisfies the following 2 criteria:
  106.  
  107.      1)  f is a continuous function of the elements of M.
  108.  
  109.      2)  Denote the upper left 3x3 submatrix of M by M3, denote the transpose 
  110.      of M3 by M3^T, and denote the identity matrix by Id. Whenever the last row 
  111.      of M is (0,0,0,1), and M3 satisfies M3 * M3^T  = a^2 * Id, then  
  112.      f = 1/|a|.
  113.  
  114.      If normalization is disabled, then the square root in equation 2.1 is 
  115.      replaced with 1, otherwise . . . .
  116.  
  117. Additions to Chapter 3 of the 1.0 Specification (Rasterization)
  118.  
  119.     None
  120.  
  121. Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations and
  122. the Framebuffer)
  123.  
  124.     None
  125.  
  126. Additions to Chapter 5 of the 1.0 Specification (Special Functions)
  127.  
  128.     None
  129.  
  130. Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
  131.  
  132.     None
  133.  
  134. Additions to the GLX Specification
  135.  
  136.     None
  137.  
  138. GLX Protocol
  139.  
  140.         None
  141.  
  142. Errors
  143.  
  144.     None
  145.  
  146. New State
  147.  
  148.     Get Value           Get Command     Type    Initial Value    Attribute
  149.     ---------           -----------     ----    -------------    ---------
  150.     RESCALE_NORMAL_EXT  IsEnabled      B         FALSE           transform/enable
  151.  
  152.  
  153. New Implementation Dependent State
  154.  
  155.     None
  156.